import allure
import jsonpath

def http_assert(case,res):
    if case['check']:
        assert jsonpath.jsonpath(res.json(), case['check'])[0] == case['expected']
    else:
        assert case['expected'] in res.text